import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { SCQuery,delAdnBackfillSCQuery,addSCQuery,putSCQuery } from './types';


/**
 *  获取征稿列表
 * @param queryParams // 条数 页数 关键字
 * @returns 
 */

export function listSolicitContributions(queryParams?: SCQuery): AxiosPromise {
    return request({
      url: 'api/draft/showdraft/',
      method: 'get',
      params: queryParams
    });
}


/**
 * 新增征稿
 *
 * @param data  添加的信息
 */
export function addSolicitContributions(data: addSCQuery) {
    return request({
      url: 'api/draft/showdraft/',
      method: 'post',
      data: data
    });
  }
/**
 * 删除征稿
 *
 * @param queryParams  // 删除的id
 */
export function delSolicitContributions(queryParams: delAdnBackfillSCQuery) {
    return request({
      url: 'api/draft/showdraft/',
      method: 'delete',
      params: queryParams
    });
  } 
/**
 * 获取单个信息
 *
 * @param queryParams  // 
 */
export function oneSolicitContributions(queryParams: delAdnBackfillSCQuery) {
    return request({
      url: 'api/draft/draftUpd/?id='+queryParams,
      method: 'get',
     
    });
  } 
/**
 * 修改征稿
 *
 * @param queryParams  
 */
export function putSolicitContributions(queryParams: putSCQuery) {
    return request({
      url: 'api/draft/draftUpd/',
      method: 'post',
      data: queryParams
    });
  } 

/**
 *  获取分类
 * @returns 
 */
export function getClassifyData(){
  return request({
    url:'api/classify/classfiy/',
    method:'get'
  })
}